#ifndef GLOBALOBSERVER_H
#define GLOBALOBSERVER_H

#include <QObject>

#include "../../protocol/groundweatherstationprotocol.h"
#include "../../protocol/mscatteringlidarprotocol.h"
#include "../../protocol/solarradiometerprotocol.h"
#include "../../protocol/visibilityprotocol.h"
#include "../../protocol/gRPC/lidar.pb.h"
#include "../device/lidarclient.h"

#include <QSerialPort>

//单例的全局控制器，device页面和show页面都绑定到此页面的信号上，不需要层层传递
class GlobalObserver: public QObject
{
    Q_OBJECT
public:
    ~GlobalObserver();
    static GlobalObserver* getInstance();
signals:
    //能见度仪
    void Sig_VisibilityProtocol(protocol::VisibilityProtocol);
    //地面气象站
    void Sig_GroundWeatherStationProtocol(protocol::GroundWeatherStationProtocol);
    //太阳辐射计
    void Sig_SolarRadioMeterProtocolNSU(const protocol::RadioMeterNSUProtocolAll& protocol);
    void Sig_SolarRadioMeterProtocolSTA(const protocol::RadioMeterSTAProtocolAll& protocol);
    void Sig_SolarRadioMeterProtocolAOD(const protocol::RadioMeterAODProtocolAll& protocol);
    void Sig_SolarRadioMeterProtocolATR(const protocol::RadioMeterATRProtocolAll& protocol);
    void Sig_SolarRadioMeterProtocolLAT(const QString& lat);
    void Sig_SolarRadioMeterProtocolLON(const QString& lon);

    void Sig_SolorRadioMeterSendPortPoint(QSharedPointer<QSerialPort> point);
    //激光雷达

    //数据反演
    void Sig_solorRadioMeterGetSTA();
    void Sig_lidarGetClint(QSharedPointer<LidarClient>);

    //数据库
    void Sig_dataBaseConnected();
    void Sig_dataBaseDisConnected();
private:
    GlobalObserver();

    static GlobalObserver* instance;
};

#endif // GLOBALOBSERVER_H
